<div class="bjui-pageContent">
    <form action="{:U('Index/save')}" data-callback="dialogFormCall" data-toggle="validate" data-alertmsg="false" class="dialogForm">
        <table class='table table-bordered groupprice'>
            <thead>
            <tr>
                <th>会员组名称</th>
                <th>价格</th>
                <th>折扣率</th>
            </tr>
            </thead>
            <tbody>
            <volist name="group" id="go">
            <tr data-memid="{$go.id}">
                <td>{$go.name}</td>
                <td><input type="text" name="" class="w60" value="{$def}" /></td>
                <td>{$go.discount}%</td>
            </tr>
            </volist>
            </tbody>
        </table>

    </form>
</div>
<script>
    $(function () {
        var vid = "{$vid}";  //tr 上的 data-value  确认目标tr
        $('.resultCall').click(function () {
            var result = [];
            $('table.groupprice tbody tr').each(function () {
                var mid = $(this).attr('data-memid'),
                        price = $(this).find('input.w60').val();
                if(price && price> 0){
                    result.push(mid+'_'+price);
                }else{
                    result = [];
                    $(this).alertmsg('error','价格未输入完整');
                    return ;
                }
            });
            if( result.length == $('table.groupprice tbody tr').length ){
                resultCallGroup(vid, result.join(','));
            }
        });
    });
</script>
<div class="bjui-pageFooter">
    <ul>
        <li><button type="button" class="btn-default resultCall" data-icon="save">确定</button></li>
    </ul>
</div>